14. Espresso Write Your Own Test
Now it's time to write an Espresso test yourself.
Step 1: Write an Espresso
- Create a new test called completedTaskDetails_DisplayedInUi and copy over this skeleton code:
TaskDetailFragmentTest.kt
@Test
fun completedTaskDetails_DisplayedInUi() = runBlockingTest{
// GIVEN - Add completed task to the DB
// WHEN - Details fragment launched to display task
// THEN - Task details are displayed on the screen
// make sure that the title/description are both shown and correct
}
- Looking at the previous test, complete this test.
- Run and confirm the test passes.